<?php

namespace App\Http\Middleware;

use Closure;

class InWechat
{
    /**
     * 必须通过微信访问
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request $request
     * @param  \Closure $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if (!isWechat()){
//            session(['openid'=>'oHwEGs2nlJMpKJO7Id7-cIJOq7cY']);
            abort(500,'请通过微信访问此页面');
        }
        return $next($request);
    }
}
